Public Class header
    Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents txtPid As System.Web.UI.WebControls.TextBox
    Protected WithEvents country As System.Web.UI.WebControls.DropDownList
    Protected WithEvents btnSearch As System.Web.UI.WebControls.Button
    Protected WithEvents form1 As System.Web.UI.HtmlControls.HtmlForm

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region
    Public imagepath As String

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim URLpage As String = ReadURLPageName()
        Select Case URLpage.ToLower
            Case "default.aspx", "login.aspx"
                imagepath = "images"
            Case Else
                imagepath = "../images"
        End Select
       
        
    End Sub
    'Sub ReadURL_PageName()
    '    Select Case ReadURLPageName().ToLower
    '        Case "gmrbl.aspx"
    '            Presets_GMRBL()
    '        Case "gmimpact.aspx"
    '            Presets_GMImpact()
    '        Case "stockview.aspx"
    '            Presets_Stocks()
    '        Case "compstorestock.aspx"
    '            Presets_CompStoreStock()
    '        Case "markdownbytype.aspx"
    '            Presets_MarkdownByType()
    '        Case "true_receipts.aspx"
    '            Presets_TrueReceipts()
    '    End Select
    'End Sub

    Private Function ReadURLPageName() As String
        Dim arrTemp As Array
        Dim intPageNamePos As Integer
        Dim strTemp As String

        arrTemp = Split(Request.Url.ToString, "/")
        intPageNamePos = arrTemp.GetUpperBound(0)
        strTemp = arrTemp(intPageNamePos)
        If InStr(strTemp, "?") > 0 Then
            arrTemp = Split(strTemp, "?")
            ReadURLPageName = LCase(arrTemp(0))
        Else
            ReadURLPageName = strTemp
        End If
    End Function
End Class
